<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <style>
        .demo1{
            height: 100px;
            width: 500px;
            background-color: pink;
            margin-top: 100px;
        }
        .list {
            width: 200px;
            height: 20px;
            background-color: peru;
        }

        li {
            height: 100px;
        }
    </style>
</head>
<body>
    <div id="root">
        <h2>我喜欢这样{{name}}的你</h2>
        <a href="https://www.baidu.com/?tn=80035161_1_dg" @click.prevent='showInfo'>点我百度</a>
        <div class="demo1" @click='showInfo'>
            <button @click='showInfo'>mm</button>
        </div>
        <ul class="list">
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
    </div>

    <script>
        new Vue({
            el:'#root',
            data:{
                name:'可爱'
            },
            methods:{
                showInfo(){
                    alert('hi')
                }
            }
        })
    </script>
</body>
</html>